package com.ezops.filter;

import com.ezops.dto.RemoteRequest;

/**
 * Criteria for finding specific report. Defines conditions/filter chosen by
 * user/system for getting specific report.
 * 
 * @author vgaurav
 * 
 */
public interface ReportCriteria {

	public enum Filter {
		// These are the filter which will be sent to OT.
		REPORT_DISPLAY_NAME, REPORT_NAME, CLIENT_NAME, FUND_NAME, AS_OF_DATE, IS_REFRESHED, IS_EOD, UESR_ID;
	}

	/**
	 * Adds filters to the Criteria.
	 * 
	 * @param filter
	 * @param filterValue
	 */
	public <T> ReportCriteria addFilter(Filter filter, T filterValue);

	/**
	 * Return the filter value of required type, If data is of different type
	 * then return null.
	 * <p>
	 * Giving away type safety to gain versatile data type support.
	 * <p>
	 * NOTE- Must take care of giving the the type which was inserted while
	 * creating criteria. If unsure about the data type then use
	 * {@code Object getFilterValue(Filter filter)}
	 * 
	 * @param filter
	 * @param type
	 * @return
	 */
	public <E> E getFilterValue(Filter filter, Class<E> type);

	/**
	 * Return the value for the given filter, if no filter defined return null.
	 * 
	 * @param filter
	 * @return
	 */
	public Object getFilterValue(Filter filter);

	/**
	 * Build the Remote request based on the filter added.
	 * 
	 * @return
	 */
	public RemoteRequest build();

}
